﻿
CREATE proc [dbo].[proc_Customer_Track_GetList]
	(
		@CustomerId uniqueidentifier
	)
As
	Select
	Id,
	CustomerId,
	Record,
	UpName,
	UpTime,
	Case When UpName='' Then '...' Else	IsNull((Select Top 1 EName From Employee Where UserName=Customer_Track.UpName),'...') End As EName,
	IsNull((Select Title From Customer_Intentions Where Id=Customer_Track.IntentionsId),'...') As Intentions,
	IsNull((Select Phases From Customer_PublicityDemand Where Id=Customer_Track.PublicityDemandId),'...') As PublicityDemand,
	IsNull((Select Title From Customer_NetworkConsciousness Where Id=Customer_Track.NetworkConsciousnessId),'...') As NetworkConsciousness,
	IsNull((Select Title From Customer_Genjin Where Id=Customer_Track.GenjinId),'...') As Genjin
	From Customer_Track 
	Where CustomerId=@CustomerId Order by UpTime Desc